package com.itheima.a04mygeneiccs;

import java.util.ArrayList;

public class GenericsDemo6 {
    public static void main(String[] args) {
        ArrayList<Ye> list1=new ArrayList<>();
        ArrayList<Fu> list2=new ArrayList<>();
        ArrayList<Zi> list3=new ArrayList<>();

        //调用method方法
        method(list1);
        //method(list2);
        //method(list3);

        list1.add(new Ye());
        list2.add(new Fu());
        list3.add(new Zi());
    }


    public static void method(ArrayList<? extends Ye> list){

    }
}

class Ye1{}
class Fu1 extends Ye1{}
class Zi1 extends Fu1{}

